package cn.ekuma.pos.pda;

import java.util.ArrayList;
import java.util.HashMap;

import cn.ekuma.pos.android.pos.R;
import android.content.Context;
import android.widget.SimpleAdapter;

public class MainMenuAdapterFactory{

	private static  String menu_toolbar_name_array[] = { "扫描器", "POS单据","平板POS"};
	private static int menu_toolbar_image_array[] = { R.drawable.icon,
			R.drawable.icon,R.drawable.icon};

	/**
	 * 构造菜单Adapter
	 * 
	 * @param menuNameArray
	 *            名称
	 * @param imageResourceArray
	 *            图片
	 * @return SimpleAdapter
	 */
	public static  SimpleAdapter getMenuAdapter(Context parentContext)
	{
		ArrayList<HashMap<String, Object>> data = new ArrayList<HashMap<String, Object>>();
		for (int i = 0; i < menu_toolbar_name_array.length; i++)
		{
			HashMap<String, Object> map = new HashMap<String, Object>();
			map.put("itemImage", menu_toolbar_image_array[i]);
			map.put("itemText", menu_toolbar_name_array[i]);
			data.add(map);
		}
		SimpleAdapter simperAdapter = new SimpleAdapter(parentContext, data,
				R.layout.item_menu, new String[] { "itemImage", "itemText" },
				new int[] { R.id.item_image, R.id.item_text });
		return simperAdapter;
	}
	
	
	
}
